<?php

	set_time_limit(0);

	if(isset($_SESSION['user'])) {
	
		$mail = new Mail();
		$mail->setSubject($_SESSION['user'] . " souhaite vous parrainer sur e-Citien");
		$mail->setContent("sponsorship", array('user' => $_SESSION['user'], 'msg' => $_POST['msg']));
		
		foreach($_POST['mails'] as $m) {

            if(filter_var($m, FILTER_VALIDATE_EMAIL)) {
                $mail->setTo($m);
                //$mail->send();
            }
		}

	}

?>